using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UtilsMaster : System.Web.UI.MasterPage
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
                MembershipUser user = Membership.GetUser();

                AdminLink.NavigateUrl = "admin/default.aspx";
                if (!Page.User.IsInRole("SueetieAdministrator"))
                {
                    AdminLI.Visible = false;
                    AdminLink.Visible = false;
                }
                UserLink.Text = "Welcome, Guest!";
                UserLink.NavigateUrl = "login.aspx";
                if (Page.User.Identity.IsAuthenticated)
                {
                    UserLink.Text = "Welcome, " + user.UserName + "!";
                    UserLink.NavigateUrl = "myaccountinfo.aspx";
                }
                if (Page.User.Identity.IsAuthenticated)
                    RegisterLI.Visible = false;

        }
    }
}
